Collision Handling Strategies

A collision occurs when two different keys hash to the same slot. We need a strategy to handle this.

Insert a Key (h(k) = k % 7)

Choose Strategy:

Separate Chaining: Each slot holds a list of all keys that hash to it. When a collision occurs, the new key is simply added to the list.

Log: